package ru.study.thinkin.chapter8;

final class UT {
	static String getString(String s) {
		System.out.println("s="+s);
		return s;
	}
	static String getNonStaticString(String s2) {
		System.out.println("s2="+s2);
		return s2;
	}
}

class Meal {
	static String s = UT.getString("static field Meal") ;
	String s2 = UT.getNonStaticString("non static field Meal");
			
	Meal() {
		System.out.println("Meal()");
	}
	public static void main(String[] args) {
		System.out.println(" Meal.main()");
	}
}

class Bread {
	Bread() {
		System.out.println("Bread()");
	}
}

class Cheese {
	Cheese() {
		System.out.println("Cheese()");
	}
}

class Lunch extends Meal{
	Lunch() {
		System.out.println("Lanch ()");
	}
}

class PortableLunch extends Lunch {
	PortableLunch() {
		System.out.println("PortableLunch ()");
	}
}

public class Sandwich extends PortableLunch {
	private Bread b = new Bread();
	static private Cheese ch = new Cheese();
	
	public Sandwich() {
		System.out.println("Sandwich()");
	}
	public static void main(String[] args) {
		new Sandwich();
	}
}
